﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HidesaburoDotNET.Core
{
    public class PlayerInfo
    {
        static Random rand;

        string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        int temporaryGameId;

        public int TemporaryGameId
        {
            get { return temporaryGameId; }
        }

        public PlayerInfo()
        {
            if (rand == null)
            {
                rand = new Random();
            }
            temporaryGameId = rand.Next();
        }

        public PlayerInfo(int temporaryGameId)
        {
            this.temporaryGameId = temporaryGameId;
        }
        public PlayerInfo(PlayerInfo info)
        {
            this.temporaryGameId = temporaryGameId;
            this.name = info.name;
        }
        public override bool Equals(object obj)
        {
            if (obj is PlayerInfo)
            {
                return (obj as PlayerInfo).temporaryGameId == this.temporaryGameId;
            }
            else
            {
                return false;
            }
        }
    }
}
